package com.zelin.advice;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * ------------------------------
 * 功能：
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/10/13-15:19
 * ------------------------------
 */
public class MyAdvice {
    public void before(){
        System.out.println("前置通知.");
    }
    public void afterReturning(){
        System.out.println("后置通知，出现异常不调用.");
    }
    public Object around(ProceedingJoinPoint pjp) throws Throwable{
        System.out.println("环绕通知-前面代码");
        Object proceed = pjp.proceed();
        System.out.println("环绕通知-后面代码");
        return proceed;
    }
    public void afterThrowing(){
        System.out.println("不得了了，出了异常了！【后置通知】");
    }
    public void after(){
        System.out.println("无论是否出现异常，都会调用！【后置通知】");
    }
}
